// ==UserScript==
// @name        EliteGuard
// @namespace   http://web.castleagegame.com/castle
// @include     http://web.castleagegame.com/castle/*
// @version     1
// ==/UserScript==

function addJQuery(callback){
	var script=document.createElement("script");
	script.setAttribute("src", "https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js");
	script.addEventListener("load", function(){
		var script=document.createElement("script");
		script.textContent="("+callback.toString()+")();";
		document.body.appendChild(script);
	}, false);
	document.body.appendChild(script);
}
function load() 
{
	var parent = $('body');
	parent.append('<button id="mybtn"></button>');
	var child = $('#mybtn');
	child.css({'color' : '#F00', 'position' : 'absolute', 'left' : '0', 'top' : '50px'});
	child.text('EliteGuard');
	child.bind('click', function()
	{
		window.open(
			'http://apps.facebook.com/castle_age/party.php?twt=jneg&jneg=true&casuser=100001280454098', 
			'_blank' // <- This is what makes it open in a new window.
		);		
		window.open(
			'http://apps.facebook.com/castle_age/party.php?twt=jneg&jneg=true&casuser=100000494391583', 
			'_blank' // <- This is what makes it open in a new window.
		);		
 	});
}
addJQuery(load);
